
import {
    getMesModelList
} from '@/api/process/mesTechnologyCharacteristic'

export const mesModelDialog = {
    data(){
        return {
            mesModelDialogVisible:false,
            getMesModelList,
            hasMesModelFooter:true,
            mesModelSearchDialog:{
                inline: true,
                formDesc: {
                    goodsCode: {
                        type: "input",
                        layout: 8,
                        label: $i18n.t("mesTechnologyCharacteristic.modelCode"),
                    },
                    goodsName: {
                        type: "input",
                        layout: 8,
                        label: $i18n.t("mesTechnologyCharacteristic.modelName"),
                    },
                }
            },
            mesModelDialogColumn:[
                {
                    type: "selection",
                },
                {
                    type: "index",
                    label: $i18n.t('common.order'),
                    fixed: "left",
                },
                {
                    prop: "goodsCode",
                    label: $i18n.t("mesTechnologyCharacteristic.modelCode"),
                    minWidth: 150,
                    showOverflowTooltip: true
                },
                {
                    prop: "goodsName",
                    label:$i18n.t("mesTechnologyCharacteristic.modelName"),
                    minWidth: 250,
                    showOverflowTooltip: true
                }
            ]
        }
    },
    methods: {
        // 弹框表格，双击表格，或者点击确定 返回选中数据
        getSelectMesModelList(data) { 
            // 调试完成记得删除控制台打印
            //console.log("选中数据", data);
            // 这里可以自定义返回字段信息 
            // 第一个入参为当前表单绑定的对象，第二个入参为要修改的字段名，第三个入参为选中数据中相应信息
            this.$set(this.formDataDialog, "modelCode", data[0].goodsCode);
            this.$set(this.formDataDialog, "modelName", data[0].goodsName);
        },
    }

}

